def test(str):
    ret=str
    print(len(str))
    min_count=len(str)
    for i in set(str):
        print(i,str.count(i))
        if str.count(i)<min_count:
            # print(i)
            min_count=str.count(i)
            print(min_count)
    for i in ret:
        if ret.count(i)==min_count:
            ret=ret.replace(i,'')
    print(ret)



if __name__=="__main__":
    test('abccddc')

